package com.gcd.alienandwheel;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;

/**
 *
 * @author Rezan Achmad
 */
public class MyUtil {

    public static FileHandle loadImage(String path) {
        return Gdx.files.classpath("com/gcd/alienandwheel/res/img/" + path);
    }
    
    public static FileHandle loadParticle(String path) {
        return Gdx.files.classpath("com/gcd/alienandwheel/res/particle/" + path);
    }

    public static Texture makeBackgroundColor(int width, int height, Color color) {
        Pixmap pixmap = new Pixmap(width, height, Pixmap.Format.RGBA8888);
        pixmap.setColor(color.r, color.g, color.b, color.a);
        pixmap.fillRectangle(0, 0, width, height);

        Texture texture = new Texture(pixmap);

        return texture;
    }
}